
CC = gcc
CFLAGS = -O3  

all: ts_test  tts_test  tts_backoff_test 

ts_test: ts_lock.o test.c
	$(CC) $(CFLAGS) -o ts_test test.c ts_lock.o -lpthread

ts_lock.o: lock.c lock.h Makefile
	$(CC) $(CFLAGS) -fPIC -DTS_LOCK -o ts_lock.o -c lock.c 

tts_test: tts_lock.o test.c
	$(CC) $(CFLAGS) -o tts_test test.c tts_lock.o -lpthread

tts_lock.o: lock.c lock.h Makefile
	$(CC) $(CFLAGS) -fPIC -DTTS_LOCK -o tts_lock.o -c lock.c 

tts_backoff_test: tts_backoff_lock.o test.c
	$(CC) $(CFLAGS) -o tts_backoff_test test.c tts_backoff_lock.o -lpthread

tts_backoff_lock.o: lock.c lock.h Makefile
	$(CC) $(CFLAGS) -fPIC -DTTS_BACKOFF_LOCK -o tts_backoff_lock.o -c lock.c 


clean:
	rm -f *.o *~ *_test 
